
<?php
    $url = new Url();
    $arr_region = LoadConfig::$region;
?>

<script type="text/javascript">

    $(document).ready(function(){

        $("#<?php echo $page?>").removeClass('numbertrang');
        $("#<?php echo $page?>").addClass('numbertrang_1');

    });

    loadBoxThongke();

    loadBoxKetQua();

    loadBoxTienIch();

    function loadBoxKetQua(){
        var url = "<?=$url->createUrl('home/boxketqua');?>";
        $.ajax({
            type: "POST",
            url: url,
            global: false,
            data:{},
            success: function(msg){
                $("#boxketqua").html(msg);
            }
        });
    }

    function loadBoxTienIch(){
        var url = "<?=$url->createUrl('home/boxtienich');?>";
        $.ajax({
            type: "POST",
            url: url,
            global: false,
            data:{},
            success: function(msg){
                $("#boxtienich").html(msg);
            }
        });
    }

    function loadBoxThongke(){
        var url = "<?=$url->createUrl('home/boxthongke');?>";
        $.ajax({
            type: "POST",
            url: url,
            global: false,
            data:{},
            success: function(msg){
                $("#boxthongke").html(msg);
            }
        });
    }

</script>

<div class="leftMain">
    <div class="titleCHAT">Chủ đề Hot</div>
    <div class="SM">

        <?php for($i=0;$i<count($data);$i++){?>
            <div class="HOT">  
                <div class="img_HOT">
                    <img width="100px" src="<?php echo $data[$i]['image_100']?>"/>
                </div>
                <div class="title_HOT">
                    <a class="color_HOT" href="<?php echo Yii::app()->createUrl('user/detail',array('id'=>$data[$i]['id'],'alias'=>$data[$i]['alias'],'page'=>1));?>">
                        <?php echo $data[$i]['title'];?> 
                    </a>
                </div>
                <div class="descrip_HOT">
                    <?php echo $data[$i]['description'];?> 
                </div>
                <div class="like_HOT">

                    <div id="fb-root" style="float: right;"></div>
                    <script>(function(d, s, id) {
                        var js, fjs = d.getElementsByTagName(s)[0];
                        if (d.getElementById(id)) return;
                        js = d.createElement(s); js.id = id;
                        js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=670383849682676&version=v2.0";
                        fjs.parentNode.insertBefore(js, fjs);
                        }(document, 'script', 'facebook-jssdk'));
                    </script>
                    <div class="fb-like" data-href="http://10h.vn<?php echo Yii::app()->createUrl('user/detail',array('id'=>$data[$i]['id'],'alias'=>$data[$i]['alias'],'page'=>1));?>" data-layout="button" data-action="like" data-show-faces="false" data-share="true"></div>

                    <a href="<?php echo Yii::app()->createUrl('user/detail',array('id'=>$data[$i]['id'],'alias'=>$data[$i]['alias'],'page'=>1));?>" class="like_face">Comment(<?php echo count($all[$i]);?>)</a>
                </div>

                <?php for($j=0;$j<count($comment[$i]);$j++){?>
                    <?php $avatar = User_veso::getAvatarUser($comment[$i][$j]['id_user']);?>
                    <div class="comment_HOT">
                        <div class="img_USER">
                            <img src="<?php echo $avatar['avatar_url'];?>" width="50" height="50" />
                        </div>
                        <div class="comment_USER">
                            <div class="name_USER"><?php echo $comment[$i][$j]['create_user'];?></div>
                            <div class="content_USER"><?php echo $comment[$i][$j]['comment'];?></div>
                            <div class="time_textCHAT"><?php echo $comment[$i][$j]['create_date'];?></div>
                        </div>
                    </div>
                    <?php }?>

                <div class="both"></div>
            </div>

            <div class="lineTK"></div> 
            <?php }?> 

        <div class="trangSM">
            Trang
            <?php
                $link = 'user/chudehot';
                $pageing = "";
                $pageing = Common::pageHot($total_page,$page,$link);
                echo $pageing;
            ?>
        </div> 

    </div>

</div>
<div class="rightMain">
    <div class="Box" id="boxketqua"></div>

    <div class="Box" id="boxtienich"></div>

    <div class="Box" id="boxthongke"></div>
</div>
<div class="both"></div>